package com.example.wangtieying.firtest;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

/**
 * Created by wangtieying on 16/7/23.
 */
public class PromptManager  {

    public static void showUpdateDialog(final Context context,String updateMsg,final String apkUrl,final String apkName)
    {
        AlertDialog.Builder builder=new AlertDialog.Builder(context);
        builder.setTitle("发现新版本");
        builder.setMessage(updateMsg);
        builder.setPositiveButton("立即更新", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                DownloadService.downNewFile(apkUrl, apkName);
                dialog.dismiss();
            }
        });
        builder.setNegativeButton("下次再说", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        builder.create().show();
    }
}
